//
//  MyController.swift
//  SnapKitTest
//
//  Created by jin on 2024/8/14.
//

import UIKit
import TangramKit

class MyController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .systemGroupedBackground
        title = "设置界面"
        
        let linear = TGLinearLayout(.vert)
        linear.tg_width.equal(.fill)
        linear.tg_height.equal(.wrap)
        linear.tg_top.equal(TGLayoutPos.tg_safeAreaMargin).offset(16)
        linear.tg_space = 1
        
        view.addSubview(linear)
        
        
        linear.addSubview(settingView)
        linear.addSubview(myView)
    }
    
    @objc func onMyClick(recognizer:UITapGestureRecognizer) {
        print("onMyClick")
    }
    
    lazy var settingView: ItemView = {
        let view = ItemView()
        view.titleView.text = "设置"
        view.leftImgView.image = UIImage(named: "Setting")
        view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onMyClick(recognizer:))))
        return view
    }()
    
    lazy var myView: ItemView = {
        let view = ItemView()
        view.titleView.text = "我的"
        view.leftImgView.image = UIImage(named: "Setting")
        view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onMyClick(recognizer:))))
        return view
    }()

}
